package com.example.jetpack_databinding.main4

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import androidx.databinding.DataBindingUtil
import com.example.jetpack_databinding.R
import com.example.jetpack_databinding.databinding.ActivityMain4Binding
import kotlinx.android.synthetic.main.activity_main5.*

class MainActivity4 : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val activityMain4Binding =
            DataBindingUtil.setContentView<ActivityMain4Binding>(this, R.layout.activity_main4)
        val userViewmodel = UserViewmodel()
        activityMain4Binding.userViewModel= userViewmodel
        userViewmodel.setUserName("Rose")
        btn.setOnClickListener {
            userViewmodel.setUserName("Rosesssss")
        }
    }
}